package com.zzy.ecommerce.service.impl;

import com.zzy.ecommerce.dao.TGoodsMapper;
import com.zzy.ecommerce.domain.TGoods;
import com.zzy.ecommerce.domain.TUser;
import com.zzy.ecommerce.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private TGoodsMapper tGoodsMapper;
    @Override
    public Integer insertOneGoods(TGoods tGoods) {
        return tGoodsMapper.insertOneGoods(tGoods);
    }

    @Override
    public List<TGoods> selectAllGoods() {
        return tGoodsMapper.selectAllGoods();
    }

    @Override
    public Integer deleteOneGoods(Integer id) {
        return tGoodsMapper.deleteOneGoods(id);
    }

    @Override
    public Integer deleteAllGoods() {
        return tGoodsMapper.deleteAllGoods();
    }

    @Override
    public Integer updateOneGoodsStock(Integer id, Integer goodsStock) {
        return tGoodsMapper.updateOneGoodsStock(id, goodsStock);
    }

    @Override
    public TGoods selectOneGoodsById(Integer id) {
        return tGoodsMapper.selectOneGoodsById(id);
    }
}
